<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>Docs For Class DB_Model</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
						<script src="../../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../../media/images/plus.png";
				imgMinus.src = "../../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../../media/images/AbstractClass_logo.png"
														alt="Abstract Class"
														title="Abstract Class"
														style="vertical-align: middle"> DB_Model</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
                <p class="implements">
            Implements interfaces:
            <ul>
                <li><a href="../../Rho/Rho_Model.html">Rho_Model</a></li>            </ul>
        </p>
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">A Model that uses a database table for storage.</p>
<p class="description"><p>This class is abstract, and so must be extended from.</p></p>
	<ul class="tags">
				<li><span class="field">abstract:</span> </li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_rho---db.inc.php.html">/rho/db.inc.php</a> (line <span class="field">698</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																																																																																																																																								<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$cache" title="details" class="var-name">$cache</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$cache_get" title="details" class="var-name">$cache_get</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$cache_list_all" title="details" class="var-name">$cache_list_all</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$database_name" title="details" class="var-name">$database_name</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$db" title="details" class="var-name">$db</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$external_field" title="details" class="var-name">$external_field</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$fetch_fields" title="details" class="var-name">$fetch_fields</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$fields" title="details" class="var-name">$fields</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$joins" title="details" class="var-name">$joins</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$limit" title="details" class="var-name">$limit</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$list_fields" title="details" class="var-name">$list_fields</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$name_field" title="details" class="var-name">$name_field</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$pk" title="details" class="var-name">$pk</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$pk_autoincrement" title="details" class="var-name">$pk_autoincrement</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$pk_is_composite" title="details" class="var-name">$pk_is_composite</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$sort" title="details" class="var-name">$sort</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">mixed</span>
					<a href="#$sort_dir" title="details" class="var-name">$sort_dir</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$table" title="details" class="var-name">$table</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$where" title="details" class="var-name">$where</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																																																																																							
				<div class="method-definition">
					<img src="../../media/images/Constructor.png" alt=" "/>
											<span class="method-result">DB_Model</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#beforeCreate" title="details" class="method-name">beforeCreate</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">&$data</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#beforeDelete" title="details" class="method-name">beforeDelete</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#beforeUpdate" title="details" class="method-name">beforeUpdate</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$data</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">int|string|array</span>
										<a href="#create" title="details" class="method-name">create</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$data</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#delete" title="details" class="method-name">delete</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#fetch" title="details" class="method-name">fetch</a>
											([<span class="var-type"></span>&nbsp;<span class="var-name">$page</span> = <span class="var-default">1</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$sort</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$sort_dir</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$qty</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">NULL</span>])
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#fetchAll" title="details" class="method-name">fetchAll</a>
											([<span class="var-type"></span>&nbsp;<span class="var-name">$sort</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$sort_dir</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">NULL</span>])
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#fields" title="details" class="method-name">fields</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">&$fields</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result"><a href="../../Rho/Rho-database/DB_Record.html">DB_Record</a>|bool</span>
										<a href="#get" title="details" class="method-name">get</a>
											(<span class="var-type">int|string|array</span>&nbsp;<span class="var-name">$id</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">NULL</span>])
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">array</span>
										<a href="#getFields" title="details" class="method-name">getFields</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result"><a href="../../Rho/Rho-database/DB_Record.html">DB_Record</a>|bool</span>
										<a href="#getForEdit" title="details" class="method-name">getForEdit</a>
											(<span class="var-type">int|string|array</span>&nbsp;<span class="var-name">$id</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#getRecordClass" title="details" class="method-name">getRecordClass</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#id_oid" title="details" class="method-name">id_oid</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span>, <span class="var-type">int|string|array</span>&nbsp;<span class="var-name">&$id</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#onCreate" title="details" class="method-name">onCreate</a>
											(<span class="var-type">$id</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$data</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#onDelete" title="details" class="method-name">onDelete</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#onUpdate" title="details" class="method-name">onUpdate</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$data</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#pkWhere" title="details" class="method-name">pkWhere</a>
											(<span class="var-type">int|string|array</span>&nbsp;<span class="var-name">&$id</span>)
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">string</span>
										<a href="#prefix" title="details" class="method-name">prefix</a>
										()
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#select" title="details" class="method-name">select</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$fields</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$sort</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$sort_dir</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$limit</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$offset</span> = <span class="var-default">NULL</span>])
									</div>
															
				<div class="method-definition">
					<img src="../../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#update" title="details" class="method-name">update</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$data</span>)
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$cache" id="$cache"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$cache</span>
			 = <span class="var-default">1000</span>			(line <span class="line-number">758</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
			</ul>
	
	
		
		

</div>
<a name="var$cache_get" id="$cache_get"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$cache_get</span>
			 = <span class="var-default">FALSE</span>			(line <span class="line-number">760</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
			</ul>
	
	
		
		

</div>
<a name="var$cache_list_all" id="$cache_list_all"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$cache_list_all</span>
			 = <span class="var-default">FALSE</span>			(line <span class="line-number">762</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$database_name" id="$database_name"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$database_name</span>
			 = <span class="var-default">'default'</span>			(line <span class="line-number">703</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> The name of the database connection to use - defaults to 'default'</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$db" id="$db"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$db</span>
						(line <span class="line-number">705</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$external_field" id="$external_field"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$external_field</span>
			 = <span class="var-default">array(<br />    'category_name'=&gt;Rho_DB::STR<br />  )</span>			(line <span class="line-number">735</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$joins">DB_Model::$joins</a></li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$fetch_fields" id="$fetch_fields"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$fetch_fields</span>
			 = <span class="var-default">array('id', 'name', 'category')</span>			(line <span class="line-number">717</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
			</ul>
	
	
		
		

</div>
<a name="var$fields" id="$fields"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$fields</span>
			 = <span class="var-default">array(<br />    'id'=&gt;Rho_DB::INT,<br />    'name'=&gt;Rho_DB::STR<br />  )</span>			(line <span class="line-number">709</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$joins" id="$joins"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$joins</span>
			 = <span class="var-default">array(<br />    'categories'=&gt;array(<br />      'fk'=&gt;'category',      <br />      'pk'=&gt;'id',<br />      'type'=&gt;Rho_DB::INNER,<br />      'on'=&gt;NULL<br />    ))</span>			(line <span class="line-number">723</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodfields">DB_Model::fields()</a></li>
			</ul>
	
	
		
		

</div>
<a name="var$limit" id="$limit"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$limit</span>
			 = <span class="var-default">12</span>			(line <span class="line-number">753</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$list_fields" id="$list_fields"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$list_fields</span>
			 = <span class="var-default">array('id', 'name', 'categories.name')</span>			(line <span class="line-number">721</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$name_field" id="$name_field"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$name_field</span>
			 = <span class="var-default">'name'</span>			(line <span class="line-number">751</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$pk" id="$pk"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$pk</span>
			 = <span class="var-default">'id'</span>			(line <span class="line-number">742</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$pk_is_composite">DB_Model::$pk_is_composite</a></li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$pk_autoincrement" id="$pk_autoincrement"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$pk_autoincrement</span>
			 = <span class="var-default">TRUE</span>			(line <span class="line-number">745</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$pk_is_composite" id="$pk_is_composite"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$pk_is_composite</span>
			 = <span class="var-default">FALSE</span>			(line <span class="line-number">749</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$pk">DB_Model::$pk</a></li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$sort" id="$sort"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$sort</span>
			 = <span class="var-default">'id'</span>			(line <span class="line-number">755</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$sort_dir" id="$sort_dir"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$sort_dir</span>
			 = <span class="var-default">'ASC'</span>			(line <span class="line-number">756</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$table" id="$table"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$table</span>
			 = <span class="var-default">''</span>			(line <span class="line-number">701</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> The name of the table this model uses - MUST be overidden by child classes.</li>
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodfields">DB_Model::fields()</a></li>
			</ul>
	
	
		
		

</div>
<a name="var$where" id="$where"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$where</span>
			 = <span class="var-default">NULL</span>			(line <span class="line-number">776</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> A default where statement (excluding the word WHERE) to be used on in statements - default is NULL.  Should be set in the constructor and properly escaped  e.g. <div class="src-code"><ol><li><div class="src-line"><span class="src-key">class&nbsp;</span><span class="src-id">News_Model&nbsp;</span><span class="src-key">extends&nbsp;</span><a href="../../Rho/Rho-database/DB_Model.html">DB_Model</a><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-id">__construct</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">parent</span><span class="src-sym">::</span><span class="src-id">__construct</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">#&nbsp;only&nbsp;show&nbsp;approved&nbsp;news&nbsp;items&nbsp;by&nbsp;default</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">where</span>=<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">where</span><span class="src-sym">(</span><span class="src-str">'approved'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="../../Rho/Rho_DB.html">Rho_DB</a><span class="src-sym">::</span><span class="src-id">INT</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><span class="src-sym">}</span></div></li>
</ol></div></li>
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodgetForEdit">DB_Model::getForEdit()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">779</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructer - child classes MUST overide this AND call parent::__construct().</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">DB_Model</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodbeforeCreate" id="beforeCreate"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">beforeCreate</span> (line <span class="line-number">1026</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Called by create() before the record is inserted.</p>
<p class="description"><p>By default, this method does nothing - override it if you need to change field data before insertion.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodcreate">DB_Model::create()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			beforeCreate
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">&$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$data</span><span class="var-description">: Associative array, where the key is the field name and the value if the field data.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodbeforeDelete" id="beforeDelete"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">beforeDelete</span> (line <span class="line-number">1015</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			beforeDelete
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
				</ul>
		
			
	</div>
<a name="methodbeforeUpdate" id="beforeUpdate"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">beforeUpdate</span> (line <span class="line-number">1007</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			beforeUpdate
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">&$data</span>			</li>
				</ul>
		
			
	</div>
<a name="methodcreate" id="create"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">create</span> (line <span class="line-number">996</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Creates a new record.</p>
	<ul class="tags">
				<li><span class="field">return:</span> The primary key of the new record.</li>
				<li><span class="field">access:</span> public</li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodonCreate">DB_Model::onCreate()</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodbeforeCreate">DB_Model::beforeCreate()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int|string|array</span>
		<span class="method-name">
			create
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$data</span><span class="var-description">: Associative array, where the key is the field name and the value is the field data.</span>			</li>
				</ul>
		
			
	</div>
<a name="methoddelete" id="delete"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">delete</span> (line <span class="line-number">1003</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			delete
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfetch" id="fetch"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">fetch</span> (line <span class="line-number">975</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			fetch
		</span>
					([<span class="var-type"></span>&nbsp;<span class="var-name">$page</span> = <span class="var-default">1</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$sort</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$sort_dir</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$qty</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">NULL</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$page</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$sort</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$sort_dir</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$qty</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$fields</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfetchAll" id="fetchAll"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">fetchAll</span> (line <span class="line-number">983</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			fetchAll
		</span>
					([<span class="var-type"></span>&nbsp;<span class="var-name">$sort</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$sort_dir</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">NULL</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$sort</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$sort_dir</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$fields</span>			</li>
				</ul>
		
			
	</div>
<a name="methodfields" id="fields"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">fields</span> (line <span class="line-number">897</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generates a list of fields and if necessary JOIN statemnts for use in a select statement.</p>
	<ul class="tags">
				<li><span class="field">return:</span> The escaped field names, the FROM statement, and any required JOIN statements.  Does not include the word 'SELECT'.</li>
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$table">DB_Model::$table</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$joins">DB_Model::$joins</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			fields
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">&$fields</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$fields</span><span class="var-description">: A list of field names.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodget" id="get"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">get</span> (line <span class="line-number">805</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Fetches a single record.</p>
<p class="description"><p>Will use the cache if $this-&gt;cache_get is TRUE, and $fields is NULL (i.e use the default fetch fields).</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> A database record, or FALSE if not found.</li>
				<li><span class="field">access:</span> public</li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodid_oid">DB_Model::id_oid()</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodpkWhere">DB_Model::pkWhere()</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodfields">DB_Model::fields()</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$where">DB_Model::$where</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$cache_get">DB_Model::$cache_get</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$fetch_fields">DB_Model::$fetch_fields</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$cache">DB_Model::$cache</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../Rho/Rho-database/DB_Record.html">DB_Record</a>|bool</span>
		<span class="method-name">
			get
		</span>
					(<span class="var-type">int|string|array</span>&nbsp;<span class="var-name">$id</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$fields</span> = <span class="var-default">NULL</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string|array</span>
				<span class="var-name">$id</span><span class="var-description">: The primary key value of the record to fetch.  If the table uses composite primary keys, this must be an associative array</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$fields</span><span class="var-description">: Optional - list of fields to retrieve. Normally $this-&gt;fetch_fields are retreived</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetFields" id="getFields"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">getFields</span> (line <span class="line-number">1050</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the fields of this model and any foreign table fields with their field type.</p>
	<ul class="tags">
				<li><span class="field">return:</span> An associative array where the key is the field name  and the value is an int indicating the field type (e.g. Rho_DB::STR ).</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getFields
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetForEdit" id="getForEdit"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">getForEdit</span> (line <span class="line-number">957</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns a single record, suitable for use in an edit form.</p>
<p class="description"><p>Will retreive all fields (using *) , and NO related table fields.  Does not use the cache.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The record, or FALSE if not found.</li>
				<li><span class="field">see:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
				<li><span class="field">throws:</span> Rho_Exception if there's a database error.</li>
				<li><span class="field">throws:</span> DB_Connection_Exception If there's a connection error.</li>
				<li><span class="field">access:</span> public</li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#var$where">DB_Model::$where</a></li>
				<li><span class="field">uses:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodpkWhere">DB_Model::pkWhere()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../Rho/Rho-database/DB_Record.html">DB_Record</a>|bool</span>
		<span class="method-name">
			getForEdit
		</span>
					(<span class="var-type">int|string|array</span>&nbsp;<span class="var-name">$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string|array</span>
				<span class="var-name">$id</span><span class="var-description">: The primary key value of the record to fetch.  If the table uses composite primary keys, this must be an associative array  where the keys are the names of the primary keys, and the values are the values to use.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetRecordClass" id="getRecordClass"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">getRecordClass</span> (line <span class="line-number">1056</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the name of the record class this model returns - normally 'DB_Record'.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getRecordClass
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodid_oid" id="id_oid"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">id_oid</span> (line <span class="line-number">847</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generates a cache object identifier for an action with a primary key value.</p>
	<ul class="tags">
				<li><span class="field">return:</span> An oid- something like: get_5</li>
				<li><span class="field">see:</span> <a href="../../Rho/Rho_Cache.html">Rho_Cache</a></li>
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			id_oid
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$method</span>, <span class="var-type">int|string|array</span>&nbsp;<span class="var-name">&$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$method</span><span class="var-description">: The name of the method calling id_oid in lowercase.</span>			</li>
					<li>
				<span class="var-type">int|string|array</span>
				<span class="var-name">&$id</span><span class="var-description">: The primary key values.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodonCreate" id="onCreate"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">onCreate</span> (line <span class="line-number">1034</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Called by create() after the record is inserted.</p>
<p class="description"><p>By default, this method does nothing - override it if you need to do something like changing rows in a related table.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodcreate">DB_Model::create()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			onCreate
		</span>
					(<span class="var-type">$id</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">&$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">&$data</span><span class="var-description">: Associative array, where the key is the field name and the value if the field data.</span>			</li>
					<li>
				<span class="var-type">$id</span>
				<span class="var-name">$id</span><span class="var-description">: int|string|array The primary key of the newly created record.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodonDelete" id="onDelete"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">onDelete</span> (line <span class="line-number">1019</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			onDelete
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
				</ul>
		
			
	</div>
<a name="methodonUpdate" id="onUpdate"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">onUpdate</span> (line <span class="line-number">1011</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			onUpdate
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">&$data</span>			</li>
				</ul>
		
			
	</div>
<a name="methodpkWhere" id="pkWhere"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">pkWhere</span> (line <span class="line-number">869</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generates a SQL snippit to be used a WHERE statement using the primary key.</p>
<p class="description"><p>Used internally by other methods.</p><p>e.g.<div class="src-code"><ol><li><div class="src-line"><span class="src-var">$id</span>=<span class="src-num">5</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$sql&nbsp;</span>.=&nbsp;<span class="src-str">'WHERE'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../../Rho/Rho-database/DB_Model.html#methodpkWhere">pkWhere</a><span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">#&nbsp;will&nbsp;return&nbsp;something&nbsp;like:&nbsp;`id`=5</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$id</span>=<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'order_id'</span>=&gt;<span class="src-num">7</span><span class="src-sym">,&nbsp;</span><span class="src-str">'item_id'</span>=&gt;<span class="src-num">19</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$sql&nbsp;</span>.=&nbsp;<span class="src-str">'WHERE'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../../Rho/Rho-database/DB_Model.html#methodpkWhere">pkWhere</a><span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">)</span><span class="src-sym">;</span><span class="src-comm">#&nbsp;will&nbsp;return&nbsp;something&nbsp;like:&nbsp;`order_id`=7&nbsp;AND&nbsp;`item_id`=19</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The snippet NOT including the word WHERE.</li>
				<li><span class="field">access:</span> protected</li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodgetForEdit">DB_Model::getForEdit()</a></li>
				<li><span class="field">usedby:</span> <a href="../../Rho/Rho-database/DB_Model.html#methodget">DB_Model::get()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			pkWhere
		</span>
					(<span class="var-type">int|string|array</span>&nbsp;<span class="var-name">&$id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string|array</span>
				<span class="var-name">&$id</span><span class="var-description">: The primary key value.  If the table uses composite primary keys, this must be an associative array  where the keys are the names of the primary keys, and the values are the values to use.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodprefix" id="prefix"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">prefix</span> (line <span class="line-number">1042</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return the cache prefix for this model.</p>
	<ul class="tags">
				<li><span class="field">return:</span> 'db.' + database name + '.' + table name .</li>
				<li><span class="field">see:</span> <a href="../../Rho/Rho_Cache.html">Rho_Cache</a></li>
				<li><span class="field">final:</span> </li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			prefix
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodselect" id="select"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">select</span> (line <span class="line-number">979</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			select
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$fields</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$sort</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$sort_dir</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$limit</span> = <span class="var-default">NULL</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$offset</span> = <span class="var-default">NULL</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$fields</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$sort</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$sort_dir</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$limit</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$offset</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupdate" id="update"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../../media/images/Method.png" />
		<span class="method-title">update</span> (line <span class="line-number">987</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			update
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">&$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">&$data</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Tue, 13 Oct 2009 19:17:22 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>